<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

    <style type="text/css">
        *{
            text-align: center;
        }
    </style>
</head>

<body>

<h1>我的京东</h1><hr/>

<c:if test="${sessionScope.user ==null  }">

    游客!
    <a href="${pageContext.request.contextPath }/regist.jsp">注册</a>
    <a href="${pageContext.request.contextPath }/login.jsp">登录</a>
</c:if>

<c:if test="${sessionScope.user !=null  }">

    ${sessionScope.user.username},欢迎光临!
    <a href="${pageContext.request.contextPath }/logout">注销</a>

    <c:if test="${sessionScope.user.role_id == 2}">
        <a href="${pageContext.request.contextPath }/seller/addProd.jsp">添加商品</a>
        <a href="${pageContext.request.contextPath }/seller/findProdByUser">管理商品</a>
    </c:if>

     <a href="${pageContext.request.contextPath }/findProdByPage?page=1&size=5">商品列表</a>
     <a href="${pageContext.request.contextPath }/cart/cartList">进入购物车</a>

     <a href="${pageContext.request.contextPath }/order/orderList">我的订单</a>

</c:if>

</body>
</html>
